package com.sxt.form;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 接收更新时的车辆提交的数据
 * bus_car
 * @author 
 */
@Data
public class BusCarForm implements Serializable {

    /**
     * 汽车ID
     */
    private Integer id;

    /**
     * 车牌号
     */
    @NotEmpty(message = "车牌号不能为空")
    @Length(min = 7, max = 8, message = "车牌号7-8位")
    private String num;

    /**
     * 类型  1 轿车  2 SUV  3 跑车
     */
    @NotNull(message = "车型不能为空")
    @Range(min = 1, max = 3, message = "车辆类型只能1-3")
    private Integer type;

    /**
     * 颜色
     */
    @NotEmpty(message = "汽车颜色不能为空")
    @Length(max = 10, message = "汽车颜色最多10位字符")
    private String color;

    /**
     * 价格
     */
    @NotNull(message = "汽车金额不能为空")
    @Range(min = 1, max = 999999999, message = "汽车金额1-999999999")
    private Integer price;

    /**
     * 出租金额
     */
    @NotNull(message = "汽车租金不能为空")
    @Range(min = 1, max = 999999999, message = "汽车租金1-999999999")
    private Integer rentPrice;

    /**
     * 押金
     */
    @NotNull(message = "汽车押金不能为空")
    @Range(min = 1, max = 999999999, message = "汽车押金1-999999999")
    private Integer deposit;

    /**
     * 出租状态 1 未出租  2 已出租
     */
    private Integer isRent;

    /**
     * 描述
     */
    @Length(max = 100, message = "汽车描述最多100个字符")
    private String descp;

    /**
     * 汽车图片
     */
    @NotEmpty(message = "汽车图片不能为空")
    @Length(max = 100, message = "汽车图片地址最多100位字符")
    private String img;

    /**
     * 版本号
     */
    private Integer version;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private Date createTime;
}